From: Joan Torres Lopez Date: Thu, 29 Jan 2026 12:46:19 +0000 (+0100) Subject: st/password-entry: Update input hints when toggling password visibility X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~39^2~1^2~9 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=7d3437cbd0f412391d4918a799d8bff1c72c4b12;p=gnome-shell.git st/password-entry: Update input hints when toggling password visibility Set the HIDDEN_TEXT hint when the password is hidden and remove it when shown. This ensures IBus is aware when it should hide pre-edit text. Part-of: --- diff --git a/src/st/st-password-entry.c b/src/st/st-password-entry.c index b55d7b1da..8c6204f37 100644 --- a/src/st/st-password-entry.c +++ b/src/st/st-password-entry.c @@ -238,6 +238,7 @@ st_password_entry_init (StPasswordEntry *entry) clutter_text_set_password_char (clutter_text, BLACK_CIRCLE); st_entry_set_input_purpose (ST_ENTRY (entry), CLUTTER_INPUT_CONTENT_PURPOSE_PASSWORD); + st_entry_set_input_hints (ST_ENTRY (entry), CLUTTER_INPUT_CONTENT_HINT_HIDDEN_TEXT); g_signal_connect (clutter_text, "notify::password-char", G_CALLBACK (clutter_text_password_char_cb), entry); @@ -317,6 +318,7 @@ st_password_entry_set_password_visible (StPasswordEntry *entry, { StPasswordEntryPrivate *priv; ClutterText *clutter_text; + ClutterInputContentHintFlags hints; g_return_if_fail (ST_IS_PASSWORD_ENTRY (entry)); @@ -331,11 +333,19 @@ st_password_entry_set_password_visible (StPasswordEntry *entry, { clutter_text_set_password_char (clutter_text, 0); st_icon_set_icon_name (ST_ICON (priv->peek_password_icon), "view-conceal-symbolic"); + + hints = st_entry_get_input_hints (ST_ENTRY (entry)); + hints &= ~CLUTTER_INPUT_CONTENT_HINT_HIDDEN_TEXT; + st_entry_set_input_hints (ST_ENTRY (entry), hints); } else { clutter_text_set_password_char (clutter_text, BLACK_CIRCLE); st_icon_set_icon_name (ST_ICON (priv->peek_password_icon), "view-reveal-symbolic"); + + hints = st_entry_get_input_hints (ST_ENTRY (entry)); + hints |= CLUTTER_INPUT_CONTENT_HINT_HIDDEN_TEXT; + st_entry_set_input_hints (ST_ENTRY (entry), hints); } g_object_notify_by_pspec (G_OBJECT (entry), props[PROP_PASSWORD_VISIBLE]);